package com.aliware.tianchi.test;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ThreadLocalRandom;

/**
 * @author lorne
 * @date 2019/6/28
 * @description
 */
public class LoadBalance {

    private static List<TestProvider> providers = new ArrayList<>();

    static {
        providers.add(new SmallProvider());
        providers.add(new MediumProvider());
        providers.add(new LargeProvider());
    }

    public static TestProvider selectOne() {
        return providers.get(ThreadLocalRandom.current().nextInt(providers.size()));
    }
}
